package com.data.JVM;

/**  -Xss2M
 * Created by wangbing on 2018/6/1.
 */
public class JavaVMStackOOM {
    private void dontstop(){
        while (true){

        }
    }

    public void stackLeakByThread(){
        while (true){
            Thread thread = new Thread(new Runnable() {
                public void run() {
                    System.out.println("线程执行");
                    dontstop();
                }
            });
            thread.start();
        }
    }

    public static void main(String[] args) {
        JavaVMStackOOM javaVMStackOOM = new JavaVMStackOOM();
        javaVMStackOOM.stackLeakByThread();
    }
}
